Ext.define('Admin.view.part.PartGridPanel', {
	extend:Ext.grid.Panel, 
	xtype:'partGridPanel', 
	id:'partGridPanel', 
	title:'用户列表', 
	bind:'{partDataList}',
	 selModel: {
		selType: 'checkboxmodel',
        checkOnly: true,
        showHeaderCheckbox: true
    },
    listeners: {
        //celldblclick : 'openEmployeeWindow',
        itemmouseenter:'partTip'
    },
    //multiSelect: true,
     dockedItems: [{
        xtype: 'toolbar',
        items: [{
            xtype: 'textfield',
            fieldLabel: '名字:',
            name:'partName',
            reference: 'partSearchPartName'
        },{
            text:'快捷查询',
            tooltip:'快捷查询',
            iconCls:'x-fa fa-search',
            handler : 'search'
        }]
    }],
    columns: [
    		//{xtype: 'rownumberer',width: 40, sortable: false},
    		{
            xtype: 'actioncolumn',
            items: [{
        		xtype: 'button',
                iconCls: 'x-fa fa-pencil',
                handler : 'openEditWindow'
            },{
                xtype: 'button',
                iconCls: 'x-fa fa-trash',
                handler : 'deletePart'
            }],
            cls: 'content-column',
            width: 120,
            //dataIndex: 'bool',
            text: '操作',
            tooltip: '操作 '
          },
         
		 { header: 'ID',  dataIndex: 'partId',hidden:true ,width: 120},
         { header: '部门名称', dataIndex: 'partName' ,width: 120},
         { header: '职能',  dataIndex: 'duty',hidden:true ,width: 120},
         { header: '部门人数', dataIndex: 'employeeNum' ,width: 120}
    ],
    columnLines: true,
	bbar: {
	    xtype: 'pagingtoolbar',//注意以后MVVM中使用新写法,不要使用Ext.create()
        //store: Ext.data.StoreManager.lookup('simpsonsStore'),
        bind: '{partDataList}',
        displayInfo: true,
        displayMsg: 'Displaying topics {0} - {1} of {2}',
        emptyMsg: "No topics to display",
        items:[
          '-', {
            text: '批量删除',
            listeners: {
			    click:'deleteParts'
			}
          },'-',{
            text: '添加部门',
            listeners: {
                click:'openAddWindow'
            }
        }]
    }
});